package com.wn32.main.demo;

import java.util.Arrays;

public class MaoPao {
    public static void main(String[] args) {
        int[] arr={2,6,4,8,9,1};
        for (int i = 0; i < arr.length; i++) {
            for (int j=0;j<arr.length-i-1;j++){
                int t=0;
                if(arr[j]>arr[j+1]){
                    t=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=t;
                }
            }
            System.out.println(Arrays.toString(arr));
        }
     }
}
